<?php header("Content-Type:text/html;   charset=utf-8"); ?>
<script type="text/javascript">
	$(function(){
		$("a[href='#maximize']").trigger("click");	
		loadAlbumTrash();
	});
	function loadAlbumTrash(){
		var uid = $("#hduid").val();
		var params = {uid:uid};	
		$.ajax({
			type:"post",
			url:"admin.php/manage/loadAlbumTrash",
			dataType:"json",
			data:params,
			success:function(data){
				//alert(data);
				//$("#ulAlbumTrash").html(data);
				$("#ulAlbumTrash").html(data.album);							
			}
		});
	}
	/*
	function showAlbumTrash(uid,id){		
		$("#hrefEditTrash").attr("href","admin.php/manage/album?id="+uid).text("相册管理");
		$("#hrefEditTrash").trigger("click");
	}
	*/
	function restoreTrash(type,id){
		var params = {id:id};		
		if(type==1){//相册
			alert(params.id);
			$.ajax({
				type:"post",
				url:"admin.php/manage/restoreAblum",
				dataType:"json",
				data:params,
				success:function(data){
					alert("操作成功");
					loadAlbumTrash();
				}
			});
		}else{ //照片
			$.ajax({
				type:"post",
				url:"admin.php/manage/restoreAblumDetail",
				dataType:"json",
				data:params,
				success:function(data){
					alert("操作成功");
					loadAlbumTrash();
				}
			});
		}
	}
	function delAlbumTrash(type,id){
		var params = {id:id};		
		if(confirm('确认要将其删除吗？')){			
			if(type==1){//彻底删除相册
				$.ajax({
					type:"post",
					url:"admin.php/manage/deleteAlbumDeep",
					dataType:"json",
					data:params,
					success:function(data){
						alert("删除成功");
						loadAlbumTrash();
					}
				});
			}else{
				$.ajax({
					type:"post",
					url:"admin.php/manage/deleteAblumDetailDeep",
					dataType:"json",
					data:params,
					success:function(data){
						alert("删除成功");
						loadAlbumTrash();
					}
				});
			}
		}
	}
	function ablumTrash(id){
		$("#hrefAblumTrash").attr("href","admin.php/manage/album?id="+id).text("相册管理");
		$("#hrefAblumTrash").trigger("click");
	}
</script>
<div class="pageContent">
	<form class="pageForm required-validate"
		onsubmit="return validateCallback(this, navTabAjaxDone);">
		<li style="display: none"><a id="hrefAblumTrash" class="edit" href=""
			lookupgroup="orgLookup"><span>修改</span></a></li>
		<div class="panelBar">
			<ul class="toolBar">	
				<li><span>快速导航：</span></li>			
				<li><a onclick='ablumTrash(<?php echo $_GET["id"];?>)' class="edit" href="javascript:void(0)"><span>相册管理</span></a></li>
			</ul>
		</div>
		<div class="pageFormContent" style="float: left; width: 100%;"
			layoutH="56">
			<div class="xiangce">
				<ul id="ulAlbumTrash">
				</ul>
			</div>			
		</div>

		<input type="hidden" id="hduid"
			value="<?php if(isset($_GET["id"])) print $_GET["id"]; else print 0;?>">

		<div class="pageFormContent"
			style="float: right; width: 460px; overflow: auto;" layoutH="56"
			id="divExistsNew"></div>
	</form>
</div>
